﻿@model IEnumerable<User>
@{
    
    SpaceHomeMoreType type = ViewData.Get<SpaceHomeMoreType>("type", SpaceHomeMoreType.TogetherFollowedUsers);
    int pageIndex = Request.QueryString.Get<int>("pageIndex", 1);
    bool isShowMore = ViewData.Get<bool>("isShowMore", false);
}
@if (Model != null && Model.Count() > 0)
{
    <ul class="tn-list">
        @foreach (var user in Model)
        { 
            <li class="tn-list-item tn-helper-clearfix tn-border-gray tn-border-bottom">
                <div class="tn-list-item-area-left">
                    @Html.ShowUserAvatar(user.UserId, AvatarSizeType.Small, true, HyperLinkTarget._blank)
                </div>
                <div class="tn-list-item-area-main">
                    <div class="tn-list-item-row tn-helper-clearfix">
                        <div class="tnc-relationship">
                            @if (type == SpaceHomeMoreType.FollowedUsersOfFollowers)
                            {
                                @Html.FollowUser(user.UserId, "加收藏", followButtonType: FollowButtonTypes.Link)
                            }
                        </div>
                        <div class="tnc-user-notename">
                            <a href="@SiteUrls.Instance().SpaceHome(user.UserName)"   class="tn-user-name" title="@user.DisplayName" target="_blank">@StringUtility.Trim(user.DisplayName, 20)</a>
                        </div>
                    </div>
                    <div class="tnc-userinfo-content tn-helper-clearfix">
                        <div class="tnc-userinfo-item">
                            @if (user.Profile != null)
                            { 
                                <div class="tn-list-item-row">
                                    <div class="tn-location">
                                        @if (user.Profile.Gender == GenderType.FeMale)
                                        {@Html.Icon(IconTypes.SmallFemale, "女")}
                                        @if (user.Profile.Gender == GenderType.Male)
                                        {@Html.Icon(IconTypes.SmallMale, "男")}
                                        @Formatter.FormatArea(user.Profile.NowAreaCode, true)
                                    </div>
                                </div>
                            }
                            <div class="tn-list-item-row tnc-usernums">
                                <span>收藏 <a href="@SiteUrls.Instance().ListFollowedUsers(user.UserName)"><strong>@user.FollowedCount</strong></a></span>
                                <span class="tn-spacer tn-text-note">|</span> <span>粉丝 <a href="@SiteUrls.Instance().ListFollowers(user.UserName)"  >
                                    <strong>@user.FollowerCount</strong></a></span> <span class="tn-spacer tn-text-note">|</span> <span>内容 <strong>@user.ContentCount</strong></span>
                            </div>
                            @if (user.Profile != null && !string.IsNullOrEmpty(user.Profile.Introduction.Trim()))
                            {
                                <div class="tn-list-item-row">
                                    简介：
                                                        @HtmlUtility.TrimHtml(user.Profile.Introduction, 100)
                                </div>
                            }
                        </div>
                    </div>
                </div>
            </li>
        }
    </ul>
}
@if (isShowMore)
{
<div class="tn-load-more tn-bg-gray tn-border-gray" plugin="GetMore">
    <a href="@Html.Raw(SiteUrls.Instance()._SpaceHomeMore(Url.SpaceKey(), (int)type, pageIndex + 1))" class="tn-action tn-action-text-icon-right">
        @Html.Icon(IconTypes.SmallCollapseOpen)
        <span class="tn-action-text">更多信息</span>
    </a>
</div>
}